/*
 * @Author: zhudaihao
 * @Date: 2022/3/13
 * @Describe: 
 */

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class Test5ConstKey extends StatefulWidget {
  const Test5ConstKey({Key? key}) : super(key: key);

  @override
  State<Test5ConstKey> createState() => _Test5ConstKeyState();
}

class _Test5ConstKeyState extends State<Test5ConstKey> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Column(
        children: [

          Center(
            child: ElevatedButton(
                onPressed: () {
                  User user0 = User("1");
                  User user1 = User("1");

                  User user2 = const User("1");
                  User user3 = const User("1");

                  debugPrint('----${user0==user1}----${user2==user3}');
                },
                child: Text("点击")),
          ),
        ],
      ),
    );
  }
}

class User {
  final String? name;

  const User(this.name);
}
